Skip to content

Fix named_ss(sys, linfun, outputs) on ModelingToolkit 11.36 - #85

Merged
baggepinnen merged 1 commit into
masterfrom
fbc/mtk-1136-linfun-inputs
Jul 24, 2026
Merged

Fix named_ss(sys, linfun, outputs) on ModelingToolkit 11.36#85
baggepinnen merged 1 commit into
masterfrom
fbc/mtk-1136-linfun-inputs

Conversation

@baggepinnen

Copy link
Copy Markdown
Member

MTK 11.36 removed the inputs field from LinearizationFunction (replaced by inputs_getter/num_inputs), so the named_ss(sys, linfun::LinearizationFunction, outputs) method throws a FieldError on any use (this is the hot path used by DyadControlSystems' get_tf).

Since v2.8.0 already requires ModelingToolkit = "11.36", the released version cannot work with any resolvable MTK, hence the patch bump to 2.8.1.

Fix: recover the input variables from the simplified system via ModelingToolkit.inputs(ssys), which the operating-point extraction a few lines below already relies on (same order assumption as before).

Added a regression test exercising linearization_functionnamed_ss(ssys, lin_fun, outputs). Verified against MTK 11.36.0: the new test passes, and DyadControlSystems' test_get_tf.jl (which hits this path) goes from FieldError to fully passing.

🤖 Generated with Claude Code

https://claude.ai/code/session_014QR4FuuvxZU9a3UrTJjg5X

MTK 11.36 removed the `inputs` field from LinearizationFunction (replaced
by `inputs_getter`/`num_inputs`), breaking the precompiled-linfun
`named_ss` method with a FieldError. Recover the input variables from the
simplified system instead, which the operating-point extraction in the
same method already does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014QR4FuuvxZU9a3UrTJjg5X
@baggepinnen
baggepinnen merged commit b8c315d into master Jul 24, 2026
2 checks passed
@baggepinnen
baggepinnen deleted the fbc/mtk-1136-linfun-inputs branch July 24, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant